//
//  HMNavigationController.m
//  黑马宝
//
//  Created by apple on 17/1/10.
//  Copyright © 2017年 itheima. All rights reserved.
//

#import "HMNavigationController.h"
#import "UIColor+CZAddition.h"

@interface HMNavigationController ()

@end

@implementation HMNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    // 设置标题的颜色
    [self.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor redColor]}];
    
    // 设置bar(64)颜色
    [self.navigationBar setBarTintColor:[UIColor cyanColor]];
    
    // 取消navBar上黑色的线
    [self.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    [self.navigationBar setShadowImage:[UIImage new]];
    
    // 取消半透明的效果,这样的话,颜色就是纯色了
    self.navigationBar.translucent = NO;
    
    // bar上所有的内容(除了标题)的颜色
    [self.navigationBar setTintColor:[UIColor whiteColor]];
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    
//    NSLog(@"%@", viewController);
//    
    if (self.viewControllers.count >= 1) {
        viewController.hidesBottomBarWhenPushed = YES; // 一定要写在跳转之前
    }
    [super pushViewController:viewController animated:animated];
    
    
}

- (UIStatusBarStyle)preferredStatusBarStyle {
    return UIStatusBarStyleLightContent;
}

//- (UIViewController *)childViewControllerForStatusBarStyle {
//    return self.topViewController;
//}

//- (UIViewController *)childViewControllerForStatusBarHidden {
//    return self.topViewController;
//}




@end
